package com.example;


import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class MyClass {
    public static void main(String[] args) {
        Schema schema = new Schema(1, "com.work.keep.entity.dao");
        addCollection(schema);
        addCollectionComments(schema);
        try {
            new DaoGenerator().generateAll(schema, "./app/src/main/java");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static void addCollectionComments(Schema schema) {
        Entity collectionComments = schema.addEntity("CollectionComments");
        collectionComments.addIdProperty().primaryKey().autoincrement();
        collectionComments.addStringProperty("key");
        collectionComments.addStringProperty("username");
        collectionComments.addStringProperty("cotent");

    }

    private static void addCollection(Schema schema) {
        Entity collection = schema.addEntity("Collection");
        collection.addIdProperty().primaryKey().autoincrement();
        collection.addStringProperty("key");
        collection.addStringProperty("username");
        collection.addStringProperty("photo");
        collection.addStringProperty("created");
        collection.addStringProperty("avater");
        collection.addStringProperty("content");
    }
}
